



window.addEvent("domready", function () {
/*
NORTH  EAST SOUTH WEST
*/
	$('moveTop').addEvents({
		click:function () {
			//move=1;
			$('mainmap').style.cursor= "progress"; 
			var mapValues = $('mainmap').getCoordinates(); 
			var url = 'getImageMap.do';
			req = 'screenWidth='+mapValues.width+'&screenHeight='+mapValues.height+'&mode='+mapMode+'&move=1';
			req = req + '&direction=NORTH';
			ajaxMapFunc(url, req, onGetMapImage );
		}
	});
	$('moveLeft').addEvents({
		click:function () {
			//move=1;
			$('mainmap').style.cursor= "progress"; 
			var mapValues = $('mainmap').getCoordinates(); 
			var url = 'getImageMap.do';
			req = 'screenWidth='+mapValues.width+'&screenHeight='+mapValues.height+'&mode='+mapMode+'&move=1';
			req = req + '&direction=EAST';
			ajaxMapFunc(url, req, onGetMapImage );
		}
	});
	$('moveRight').addEvents({
		click:function () {
			//move=1;
			$('mainmap').style.cursor= "progress"; 
			var mapValues = $('mainmap').getCoordinates(); 
			var url = 'getImageMap.do';
			req = 'screenWidth='+mapValues.width+'&screenHeight='+mapValues.height+'&mode='+mapMode+'&move=1';
			req = req + '&direction=WEST';
			ajaxMapFunc(url, req, onGetMapImage );
		}
	});
	$('moveBottom').addEvents({
		click:function () {
			//move=1;
			$('mainmap').style.cursor= "progress"; 
			var mapValues = $('mainmap').getCoordinates(); 
			var url = 'getImageMap.do';
			req = 'screenWidth='+mapValues.width+'&screenHeight='+mapValues.height+'&mode='+mapMode+'&move=1';
			req = req + '&direction=SOUTH';
			ajaxMapFunc(url, req, onGetMapImage );
		}
	});
	var scalefactor = 0 ;
	$('zoomUp').addEvents({
		
		click:function () {
			if(scalefactor<0) scalefactor= 0;
			scalefactor = parseInt(scalefactor)+1;
			alert(scalefactor);
			$('mainmap').style.cursor= "progress"; 
			var mapValues = $('mainmap').getCoordinates(); 
			var url = 'getImageMap.do';
			req = 'screenWidth='+mapValues.width+'&screenHeight='+mapValues.height+'&mode='+mapMode+'&move=2';
			req = req + '&scaleFator='+scalefactor;
			ajaxMapFunc(url, req, onGetMapImage );
		}
	});
	$('zoomDown').addEvents({
		click:function () {
			if(scalefactor>0) scalefactor= 0;
			scalefactor = parseInt(scalefactor)-1;
			alert(scalefactor);
			$('mainmap').style.cursor= "progress"; 
			var mapValues = $('mainmap').getCoordinates(); 
			var url = 'getImageMap.do';
			req = 'screenWidth='+mapValues.width+'&screenHeight='+mapValues.height+'&mode='+mapMode+'&move=2';
			req = req + '&scaleFator='+scalefactor;
			ajaxMapFunc(url, req, onGetMapImage );
		}
	});
	
	
	
	
});